package com.shangrila.biz.common;

import java.util.Date;

/**
 * @author kalman03
 */
public class ShangrilaItemQuery {

	/** 所属一级类目 ：按人分，还是按照价格区间分 */
	private long categoryLevel1;
	/** 所属二级类目：如价格区间的50元区 */
	private long categoryLevel2;
	/** 时间 */
	private Date date;

	private int start = 0;
	private int end = 1000;
	
	public long getCategoryLevel1() {
		return categoryLevel1;
	}

	public void setCategoryLevel1(long categoryLevel1) {
		this.categoryLevel1 = categoryLevel1;
	}

	public long getCategoryLevel2() {
		return categoryLevel2;
	}

	public void setCategoryLevel2(long categoryLevel2) {
		this.categoryLevel2 = categoryLevel2;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getEnd() {
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}
	
	void check(){
		if(start <0 ){
			throw new IllegalArgumentException("start parameter is not valid.");
		}
		if(end <0 ){
			throw new IllegalArgumentException("end parameter is not valid.");
		}
		if(Math.abs(end - start) > 1000){
			throw new IllegalArgumentException("query too much.");
		}
	}
}
